package com.ruoyi.sale.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.company.service.impl.ChineseName;
import com.ruoyi.product.domain.Product;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 销售订单主表 实体类
 *
 * @author WangChangShuo
 * @date 2022年05月09日 17:19
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SaleorderOrder extends BaseEntity {

    private Long id;
    private String shPhone;
    private String shName;
    private String shAddress;
    private String isPurchase;
    private String userName;
    private String beginTime;
    private String endTime;
    private String updateStatus;//0是批量下载合同 1是批量废弃订单 2是批量确认付款

    /**
     * 销售订单主键
     */
    private Long saleorderId;
    /**
     * 销售订单日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date saleorderDate;
    /**
     * 销售订单编号
     */
    private String saleorderNum;
    /**
     * 采购订单Id
     */
    private Long purchaseId;
    /**
     * 采购订单编号
     */
    private String purchaseNum;
    /**
     * 创建人的deptid
     */
    private Long deptId;
    /**
     * 登录人的Userid
     */
    private Long UserId;
    /**
     * 客户的companyId
     */
    private Long companyId;
    /**
     * 客户的deptName
     */
    private String deptName;
    /**
     * 业务员主键userid
     */
    private Long saleorderUserId;
    /**
     * 业务员用户名称
     */
    private String saleorderUserName;
    /**
     * 订单金额
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal saleorderAmount;
    /**
     * 订单含税金额
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal saleorderTaxamount;
    /**
     * 税率
     */
    private String taxRate;
    /**
     * 付款方式
     */
    private String payMethod;
    /**
     * 开票类型
     */
    private String billType;
    /**
     * 销售订单备注
     */
    private String saleOrderRemark;
    /**
     * 是否付款
     */
    private String isPay;
    /**
     * isInvoice
     */
    private String isInvoice;
    /**
     * 订单状态
     */
    private String saleorderStatus;
    /**
     * 销售订单审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date auditTime;
    /**
     * 是否已生成销售订单
     */
    private String isCreateGoods;
    /**
     * 存储的pdf地址
     */
    private String pdfUrl;
    @ChineseName("总数")
    private int allNum;
    /**
     * 与saleordermodel 是一对多的关系
     */
    private List<SaleorderModel> saleorderModels;
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal taxPrice;
    /**
     * 含税金额
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal taxTotal;
    private String productName;
    /**
     * 产品类型
     */
    private String productType;
    /**
     * /**
     * 产品子集
     */
    private List<Product> products;
    /**
     * 下载地址
     */
    private String download;
    /**
     * 是否废弃
     */
    private String abandonment;

    public Object getFieldValue(Object obj, Field field) {
        try {
            field.setAccessible(true);
            return field.get(obj);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
            return null;
        }
    }

    public String getUpdateStatus() {
        return updateStatus;
    }

    public void setUpdateStatus(String updateStatus) {
        this.updateStatus = updateStatus;
    }

    public int getAllNum() {
        return allNum;
    }
    //private boolean isChecked;

    public void setAllNum(int allNum) {
        this.allNum = allNum;
    }

    public BigDecimal getTaxPrice() {
        return taxPrice;
    }

    public void setTaxPrice(BigDecimal taxPrice) {
        this.taxPrice = taxPrice;
    }

    public BigDecimal getTaxTotal() {
        return taxTotal;
    }

    public void setTaxTotal(BigDecimal taxTotal) {
        this.taxTotal = taxTotal;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductType() {
        return productType;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getShPhone() {
        return shPhone;
    }

    public void setShPhone(String shPhone) {
        this.shPhone = shPhone;
    }

    public String getShName() {
        return shName;
    }

    public void setShName(String shName) {
        this.shName = shName;
    }

    public String getShAddress() {
        return shAddress;
    }

    public void setShAddress(String shAddress) {
        this.shAddress = shAddress;
    }

    public String getIsPurchase() {
        return isPurchase;
    }

    public void setIsPurchase(String isPurchase) {
        this.isPurchase = isPurchase;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getAbandonment() {
        return abandonment;
    }

    public void setAbandonment(String abandonment) {
        this.abandonment = abandonment;
    }

    public void setIsChecked(Boolean isChecked) {
        isChecked = isChecked;
    }

    public String getSaleorderUserName() {
        return saleorderUserName;
    }

    public void setSaleorderUserName(String saleorderUserName) {
        this.saleorderUserName = saleorderUserName;
    }

    public Long getSaleorderId() {
        return saleorderId;
    }

    public void setSaleorderId(Long saleorderId) {
        this.saleorderId = saleorderId;
    }

    public Date getSaleorderDate() {
        return saleorderDate;
    }

    public void setSaleorderDate(Date saleorderDate) {
        this.saleorderDate = saleorderDate;
    }

    public String getSaleorderNum() {
        return saleorderNum;
    }

    public void setSaleorderNum(String saleorderNum) {
        this.saleorderNum = saleorderNum;
    }

    public Long getPurchaseId() {
        return purchaseId;
    }

    public void setPurchaseId(Long purchaseId) {
        this.purchaseId = purchaseId;
    }

    public String getPurchaseNum() {
        return purchaseNum;
    }

    public void setPurchaseNum(String purchaseNum) {
        this.purchaseNum = purchaseNum;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getUserId() {
        return UserId;
    }

    public void setUserId(Long userId) {
        UserId = userId;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Long getSaleorderUserId() {
        return saleorderUserId;
    }

    public void setSaleorderUserId(Long saleorderUserId) {
        this.saleorderUserId = saleorderUserId;
    }

    public BigDecimal getSaleorderAmount() {
        return saleorderAmount;
    }

    public void setSaleorderAmount(BigDecimal saleorderAmount) {
        this.saleorderAmount = saleorderAmount;
    }

    public BigDecimal getSaleorderTaxamount() {
        return saleorderTaxamount;
    }

    public void setSaleorderTaxamount(BigDecimal saleorderTaxamount) {
        this.saleorderTaxamount = saleorderTaxamount;
    }

    public String getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(String taxRate) {
        this.taxRate = taxRate;
    }

    public String getPayMethod() {
        return payMethod;
    }

    public void setPayMethod(String payMethod) {
        this.payMethod = payMethod;
    }

    public String getBillType() {
        return billType;
    }

    public void setBillType(String billType) {
        this.billType = billType;
    }

    public String getSaleOrderRemark() {
        return saleOrderRemark;
    }

    public void setSaleOrderRemark(String saleOrderRemark) {
        this.saleOrderRemark = saleOrderRemark;
    }

    public String getIsPay() {
        return isPay;
    }

    public void setIsPay(String isPay) {
        this.isPay = isPay;
    }

    public String getIsInvoice() {
        return isInvoice;
    }

    public void setIsInvoice(String isInvoice) {
        this.isInvoice = isInvoice;
    }

    public String getSaleorderStatus() {
        return saleorderStatus;
    }

    public void setSaleorderStatus(String saleorderStatus) {
        this.saleorderStatus = saleorderStatus;
    }

    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    public String getIsCreateGoods() {
        return isCreateGoods;
    }

    public void setIsCreateGoods(String isCreateGoods) {
        this.isCreateGoods = isCreateGoods;
    }

    public String getPdfUrl() {
        return pdfUrl;
    }

    public void setPdfUrl(String pdfUrl) {
        this.pdfUrl = pdfUrl;
    }

    public List<SaleorderModel> getSaleorderModels() {
        return saleorderModels;
    }

    public void setSaleorderModels(List<SaleorderModel> saleorderModels) {
        this.saleorderModels = saleorderModels;
    }

    public List<Product> getProducts() {
        return products;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }

    public String getDownload() {
        return download;
    }

    public void setDownload(String download) {
        this.download = download;
    }


}
